package com.yihu.cms.service;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;

import com.yihu.beans.Material;
import com.yihu.dataService.hessian.mongodb.interfaceService.MaterialHService;
import com.yihu.dataService.hessian.resource.ResourceMongoDBManager;

public class MaterialService {
	
	
	public List<Material> getAll() {
		List<Material> result = new ArrayList<Material>();
		try {
			MaterialHService mhs = (MaterialHService) ResourceMongoDBManager
					.getSingleton().getBeans("materialHSC");

			result = mhs.getAllMaterial();
		} catch (MalformedURLException e) {
			System.out.println(e.toString());
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		
		return result;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
